FUNCTION ZFIFM_VIM_MAP_ENH_EXIT .
*"----------------------------------------------------------------------
*"*"本地接口：
*"  IMPORTING
*"     VALUE(IP_FIELDNAME) TYPE  FIELDNAME OPTIONAL
*"     VALUE(IP_DOC_HEADER) TYPE  /OPT/VIM_1HEAD
*"     VALUE(IP_DOC_ITEM) TYPE  /OPT/VIM_1ITEM
*"  TABLES
*"      TP_DOC_ITEMS STRUCTURE  /OPT/VIM_1ITEM
*"      TP_EXTDATA_HEAD STRUCTURE  /OPT/VIM_1REXTDATA
*"      TP_EXTDATA_ITEM STRUCTURE  /OPT/VIM_1REXTDATA
*"  CHANGING
*"     VALUE(CP_VALUE) TYPE  /OPT/F_VALUE
*"----------------------------------------------------------------------

  DATA:
    LV_LIFNR         TYPE EKKO-LIFNR,
    LV_VENDOR_TAX_NO TYPE LFA1-STCD5,
    LV_TAX_RATE      TYPE KONP-KBETR,
    LV_LEN           TYPE I,
    LV_START         TYPE I.


* begin VIMI-18411 - optional RFC authorization check
  IF /OPT/VIM_AUTH_CHECK=>CHECK_RFC( ) <> 0.
    EXIT.
  ENDIF.
* end VIMI-18411

  IF NOT IP_FIELDNAME IS INITIAL.

    CASE IP_FIELDNAME.


      WHEN 'XBLNR'.
        IF IP_DOC_HEADER-XBLNR IS INITIAL.
          CP_VALUE = IP_DOC_HEADER-LXBLNR.
          CONDENSE CP_VALUE.

          LV_LEN = STRLEN( CP_VALUE ).
          IF LV_LEN <= 16.
            CP_VALUE = CP_VALUE.
          ELSE.
            LV_START = LV_LEN - 16.
            CP_VALUE = CP_VALUE+LV_START.
          ENDIF.

          CONDENSE CP_VALUE.

        ENDIF.

      WHEN OTHERS.

    ENDCASE.
  ENDIF.
ENDFUNCTION.
